package com.lee.Utils;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * Created by dgyl1 on 2017/3/12.
 */
public class FileUtils {
    public static void writeByteArrayToFile(File file, byte[] data) {
        FileOutputStream fo = null;
        try {
            fo = new FileOutputStream(file);
            fo.write(data);
            fo.flush();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (fo != null) {
                try {
                    fo.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                fo = null;
            }
        }
    }

}
